<template>
	<p>{{ t('age') }}</p>
	<button @click="locale === 'zh' ? (locale = 'en') : (locale = 'zh')">切换语言</button>
</template>

<script lang="ts" setup>
import { useI18n } from 'petite-vue-i18n'
// 获取 i18n 实例
const { locale, t } = useI18n()
</script>
